#include "GameLoseState.h"

GameLoseState::GameLoseState(BeanieCore* a_core, bool a_renew)
{
	m_core = a_core;

	m_name = "GameLoseState";
	m_selfId = GAMELOSE;
	m_swapId = GAMELOSE;
	m_completed = false;
	m_renew = a_renew;
}

void GameLoseState::init()
{
	m_losebg.initTexture(m_core,BG_LOSE,
		TEX_TOPLEFT,V2D_ZERO,V2D_DOUBLE,0.0f,true);
	m_retry.initTexture(m_core,BTN_RETRY,
		TEX_TOPLEFT,V2DF(170,454),V2D_ONES,0.0f,true);
	m_mainmenu.initTexture(m_core,BTN_MAINMENU,
		TEX_TOPLEFT,V2DF(880,454),V2D_ONES,0.0f,true);

	m_retry.onClick([&](){m_swapId=GAMEPLAY;m_completed=true;});
	m_mainmenu.onClick([&](){m_swapId=GAMEMENU;m_completed=true;});
}

void GameLoseState::release()
{

}

void GameLoseState::input()
{
	m_retry.input();
	m_mainmenu.input();
}

void GameLoseState::update()
{
	m_losebg.update();
	m_retry.update();
	m_mainmenu.update();
}

void GameLoseState::draw()
{
	m_losebg.draw();
	m_retry.draw();
	m_mainmenu.draw();
}

void GameLoseState::preLoop()
{
	
}

void GameLoseState::postLoop()
{

}